import request from '@/utils/request'

export function login(username, password) {
  return request({
    url: '/sso/login',
    method: 'post',
    data: {
      username,
      password
    }
  })
}

export function updateInfo(data) {
  return request({
    url: '/sso/updateInfo',
    method: 'post',
    data: data
  })
}

export function getInfo() {
  return request({
    url: '/sso/info',
    method: 'get',
  })
}

// export function logout() {
//   return request({
//     url: '/sso/logout',
//     method: 'post'
//   })
// }

export function refreshToken() {
  return request({
    url: '/sso/list',
    method: 'get'
  })
}

export function createMember(data) {
  return request({
    url: '/sso/register',
    method: 'post',
    data: data
  })
}


export function updatePassword(params) {
  return request({
    url: '/sso/updatePassword',
    method: 'post',
    params: params
  })
}

export function getAuthCodeForUpdatePWD(params) {
  return request({
    url: '/sso/getAuthCodeForUpdatePWD',
    method: 'get',
    params: params
  })
}

